

const code={
    SUCCESS:200,
    ERROR:500
}

function result(code,msg,data=null){
    return {code:code,msg:msg,data:data};
}

function success(msg='成功',data){
    return {code:code.SUCCESS,msg:msg,data:data};
}

function error(msg){
    return {code:code.ERROR,msg:msg};
}


export default{
    result,success,error,code
}